/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */

/*
 * Credenza
 *
 * Copyright (C) 1999, 2000 Eazel, Inc.
 *
 * Credenza is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * Credenza is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 * Authors: John Sullivan <sullivan@eazel.com>
 */

/* credenza-bookmark-list.h - interface for centralized list of bookmarks.
 */

#ifndef CREDENZA_BOOKMARK_LIST_H
#define CREDENZA_BOOKMARK_LIST_H

#include <libcredenza-private/credenza-bookmark.h>
#include <gio/gio.h>

typedef struct CredenzaBookmarkList CredenzaBookmarkList;
typedef struct CredenzaBookmarkListClass CredenzaBookmarkListClass;

#define CREDENZA_TYPE_BOOKMARK_LIST credenza_bookmark_list_get_type()
#define CREDENZA_BOOKMARK_LIST(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST ((obj), CREDENZA_TYPE_BOOKMARK_LIST, CredenzaBookmarkList))
#define CREDENZA_BOOKMARK_LIST_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_CAST ((klass), CREDENZA_TYPE_BOOKMARK_LIST, CredenzaBookmarkListClass))
#define CREDENZA_IS_BOOKMARK_LIST(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CREDENZA_TYPE_BOOKMARK_LIST))
#define CREDENZA_IS_BOOKMARK_LIST_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_TYPE ((klass), CREDENZA_TYPE_BOOKMARK_LIST))
#define CREDENZA_BOOKMARK_LIST_GET_CLASS(obj) \
  (G_TYPE_INSTANCE_GET_CLASS ((obj), CREDENZA_TYPE_BOOKMARK_LIST, CredenzaBookmarkListClass))

struct CredenzaBookmarkList {
	GObject object;

	GList *list; 
	GFileMonitor *monitor;
	GQueue *pending_ops;
};

struct CredenzaBookmarkListClass {
	GObjectClass parent_class;
	void (* contents_changed) (CredenzaBookmarkList *bookmarks);
};

GType                   credenza_bookmark_list_get_type            (void);
CredenzaBookmarkList *  credenza_bookmark_list_new                 (void);
void                    credenza_bookmark_list_append              (CredenzaBookmarkList   *bookmarks,
								    CredenzaBookmark *bookmark);
gboolean                credenza_bookmark_list_contains            (CredenzaBookmarkList   *bookmarks,
								    CredenzaBookmark *bookmark);
void                    credenza_bookmark_list_delete_item_at      (CredenzaBookmarkList   *bookmarks,
								    guint                   index);
void                    credenza_bookmark_list_delete_items_with_uri (CredenzaBookmarkList *bookmarks,
								    const char		   *uri);
void                    credenza_bookmark_list_insert_item         (CredenzaBookmarkList   *bookmarks,
								    CredenzaBookmark *bookmark,
								    guint                   index);
guint                   credenza_bookmark_list_length              (CredenzaBookmarkList   *bookmarks);
CredenzaBookmark *      credenza_bookmark_list_item_at             (CredenzaBookmarkList   *bookmarks,
								    guint                   index);
void                    credenza_bookmark_list_move_item           (CredenzaBookmarkList *bookmarks,
								    guint                 index,
								    guint                 destination);
void                    credenza_bookmark_list_set_window_geometry (CredenzaBookmarkList   *bookmarks,
								    const char             *geometry);
const char *            credenza_bookmark_list_get_window_geometry (CredenzaBookmarkList   *bookmarks);

#endif /* CREDENZA_BOOKMARK_LIST_H */
